/*
 * Copyright (c) 2012 Google Inc.
 *
 * All rights reserved. This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at
 *
 * http://www.eclipse.org/legal/epl-v10.html
 */
package com.google.eclipse.xtext.filename.resource;

import org.eclipse.emf.common.util.URI;

/**
 * Utility methods related to <code>{@link URI}</code>s.
 *
 * @author alruiz@google.com (Alex Ruiz)
 */
final class URIs {

  /**
   * Indicates whether the given <code>{@link URI}</code> refers to a "MyDsl" file.
   * @param uri the given {@code URI}. It may be {@code null}.
   * @return {@code true} if the given {@code URI} belongs to a "MyDsl" file, {@code false}
   * otherwise.
   */
  static boolean isMyDslFile(URI uri) {
    if (uri == null) return false;
    String fileName = uri.lastSegment();
    return "MyDsl".equals(fileName);
  }

  private URIs() {}
}
